package service;

import helpers.ElectronicIdConstant;

import java.util.List;

import models.Rate;

public class RateResolver {

	public Rate getRate(String electronicId) {
		Rate rate = null;

		if (ElectronicIdConstant.BONCHON_BATANGAS.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"BCC Batangas Provincial Rate").fetch();
			rate = rates.get(0);
		} else if (ElectronicIdConstant.BONCHON_PASEO.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"BCC Paseo Provincial Rate").fetch();
			rate = rates.get(0);
		} else if (ElectronicIdConstant.BONCHON_BAGUIO.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"BCC Baguio Provincial Rate").fetch();
			rate = rates.get(0);
		} else if (ElectronicIdConstant.BONCHON_MARQUEE.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"BCC Marquee Provincial Rate").fetch();
			rate = rates.get(0);
		} else if (ElectronicIdConstant.BONCHON_LUMINA.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"BCC Lumina Provincial Rate").fetch();
			rate = rates.get(0);
		} else if (ElectronicIdConstant.CRYSTALITE_LAGUNA.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"CRYSTALITE Laguna").fetch();
			rate = rates.get(0);
		} else if (ElectronicIdConstant.SONIC.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"Sonic 350").fetch();
			rate = rates.get(0);
		} else if (ElectronicIdConstant.SONIC_2.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"Sonic 310").fetch();
			rate = rates.get(0);
		} else if (ElectronicIdConstant.BAGNETIFIED_SANMATEO.equals(electronicId)) {
			final List<Rate> rates = Rate.find("description",
					"Bagnetified San Mateo").fetch();
			rate = rates.get(0);
		} else {
			final List<Rate> rates = Rate.find("description", "Regular")
					.fetch();
			rate = rates.get(0);
		}

		return rate;
	}

}
